import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class ColorPanel extends JPanel
{ 
    Color _currColor;
    ValueHolder _red, _green, _blue;

    public ColorPanel(ValueHolder red, ValueHolder green, ValueHolder blue)
    {
        _red = red;
        _green = green;
        _blue = blue;
        _currColor = new Color(_red.getValue(),_green.getValue(),_blue.getValue());
        this.setBackground(_currColor);
    }
    public void changeColor()
    {
        _currColor = new Color(_red.getValue(),_green.getValue(),_blue.getValue());
        this.setBackground(_currColor);
        this.repaint();
    }
    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
    }
}
